package com.qiangqiang.repository;

import com.qiangqiang.entity.Visit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by q on 2018/2/1.
 */
public interface VisitRepository extends JpaRepository<Visit, Integer> {
    /**
     * 根据时间段查询所有来访记录（暂不分页）
     */
    @Query(value = "select * from visit where time>?1 and time<?2", nativeQuery = true)
    List<Visit> queryByTimeQuantum(String startTime, String endTime);

    /**
     * 根据被访人查询所有记录
     */
    List<Visit> queryAllBySId(String sId);

    /**
     * 增加一条来访记录
     */

}
